package cn.software.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;

/**
 * 考试记录表
 * @TableName stu_test_record
 */
@TableName(value ="stu_test_record")
public class StuTestRecord implements Serializable {
    /**
     * 考试记录id
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 学生考试id
     */
    private Integer stuTestId;

    /**
     * 题目id
     */
    private Integer topicId;

    /**
     * 答案
     */
    private String answer;

    /**
     * 题目得分
     */
    private Integer score;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /**
     * 考试记录id
     */
    public Integer getId() {
        return id;
    }

    /**
     * 考试记录id
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * 学生考试id
     */
    public Integer getStuTestId() {
        return stuTestId;
    }

    /**
     * 学生考试id
     */
    public void setStuTestId(Integer stuTestId) {
        this.stuTestId = stuTestId;
    }

    /**
     * 题目id
     */
    public Integer getTopicId() {
        return topicId;
    }

    /**
     * 题目id
     */
    public void setTopicId(Integer topicId) {
        this.topicId = topicId;
    }

    /**
     * 答案
     */
    public String getAnswer() {
        return answer;
    }

    /**
     * 答案
     */
    public void setAnswer(String answer) {
        this.answer = answer;
    }

    /**
     * 题目得分
     */
    public Integer getScore() {
        return score;
    }

    /**
     * 题目得分
     */
    public void setScore(Integer score) {
        this.score = score;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        StuTestRecord other = (StuTestRecord) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getStuTestId() == null ? other.getStuTestId() == null : this.getStuTestId().equals(other.getStuTestId()))
            && (this.getTopicId() == null ? other.getTopicId() == null : this.getTopicId().equals(other.getTopicId()))
            && (this.getAnswer() == null ? other.getAnswer() == null : this.getAnswer().equals(other.getAnswer()))
            && (this.getScore() == null ? other.getScore() == null : this.getScore().equals(other.getScore()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getStuTestId() == null) ? 0 : getStuTestId().hashCode());
        result = prime * result + ((getTopicId() == null) ? 0 : getTopicId().hashCode());
        result = prime * result + ((getAnswer() == null) ? 0 : getAnswer().hashCode());
        result = prime * result + ((getScore() == null) ? 0 : getScore().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", stuTestId=").append(stuTestId);
        sb.append(", topicId=").append(topicId);
        sb.append(", answer=").append(answer);
        sb.append(", score=").append(score);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}